/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clientgui;

import client.Strings;

import client.ServerMessages;

import java.awt.Dimension;
import java.io.IOException;
import javax.swing.*;

/**
 *s
 * @author orhe
 */
public class MainWin extends javax.swing.JFrame {

    /**
     * Creates new form NewJFrame
     */
    public MainWin(){
        try {
            messages= new ServerMessages();
        } catch (IOException ex) {
        popupError("Cannot connect to server !");
        }
        
        initComponents();
        CreateForumPanel.setVisible(false);
        //GenUserPassPanel.setVisible(false);
        GuestPanel.setVisible(true);
        GuestSubForumsListPanel.setVisible(false);
        ForumsListPanel.setVisible(false);
        LoginPanel.setVisible(false);
        RegisterPanel.setVisible(false); 
        ThreadListPanel.setVisible(false);
        ThreadPanel.setVisible(false);
        AddReplyPanel.setVisible(false);
        AddThreadPanel.setVisible(false);
        SubForumsListPanel.setVisible(false);
        CreateSubForumPanel.setVisible(false);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

       /* WelcomePanel = new javax.swing.JPanel();
        welcomeLabel = new javax.swing.JLabel();
        GenForumButton = new javax.swing.JButton();
        GenUserPassPanel = new javax.swing.JPanel();
        welcomeLabel1 = new javax.swing.JLabel();*/
        GenUsernameLabel = new javax.swing.JLabel();
        GenPassLabel = new javax.swing.JLabel();
        GenUserTextField = new javax.swing.JTextField();
        UserPassButton = new javax.swing.JButton();
        GenDescLabel = new javax.swing.JLabel();
        GenPassPassField = new javax.swing.JPasswordField();
        GuestPanel = new javax.swing.JPanel();
        GuestPanelHeadlineLabel = new javax.swing.JLabel();
        GuestSubs = new javax.swing.JPanel();
      //UserPanel = new javax.swing.JPanel();
        UserPanelHeadlineLabel = new javax.swing.JLabel();
        RegisterButton = new javax.swing.JButton();
        LoginButton = new javax.swing.JButton();
        ForumsLoginList = new javax.swing.JList();
        LogoutButton = new javax.swing.JButton();
        ForumsListButton = new javax.swing.JButton();
        CreateForumButton = new javax.swing.JButton();
        ForumsListPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jScrollPane12 = new javax.swing.JScrollPane();
        jScrollPane13 = new javax.swing.JScrollPane();
        ForumListList = new javax.swing.JList();
        EnterForumButton = new javax.swing.JButton();
        ForumListBackButton = new javax.swing.JButton();
        SubForumsListPanel = new javax.swing.JPanel();
        GuestSubForumsListPanel = new javax.swing.JPanel();
        SubForumListLabel = new javax.swing.JLabel();
        GuestSubForumListLabel = new javax.swing.JLabel();
        GuestEnterSubForumButton = new javax.swing.JButton();
        GuestBackButton = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        SubForumListList = new javax.swing.JList();
        GuestSubForumListList = new javax.swing.JList();
        EnterSubForumButton = new javax.swing.JButton();
        SubForumListLogoutButton = new javax.swing.JButton();
        CreateSubForumButton = new javax.swing.JButton();
        CreateForumPanel = new javax.swing.JPanel();
        CreateForumLabel = new javax.swing.JLabel();
        ForumNameLabel = new javax.swing.JLabel();
        ForumNameTextField = new javax.swing.JTextField();
        AdminLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jScrollPane14 = new javax.swing.JScrollPane();
        AdminList = new javax.swing.JList();
        CreateForumCreateButton = new javax.swing.JButton();
        CancelButton = new javax.swing.JButton();
        CreateSubForumPanel = new javax.swing.JPanel();
        CreateForumLabel1 = new javax.swing.JLabel();
        SubForumNameLabel = new javax.swing.JLabel();
        SubForumNameTextField = new javax.swing.JTextField();
        SubAdminLabel = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        SubAdminList = new javax.swing.JList();
        CreateSubForumCreateButton = new javax.swing.JButton();
        SubCancelButton = new javax.swing.JButton();
        RegisterPanel = new javax.swing.JPanel();
        HeadlineRegisterLabel = new javax.swing.JLabel();
        UsernameLabel = new javax.swing.JLabel();
        PasswordLabel = new javax.swing.JLabel();
        UsernameTextField = new javax.swing.JTextField();
        PassTextField = new javax.swing.JPasswordField();
        RegisterRegButton = new javax.swing.JButton();
        ForumsRegList = new javax.swing.JList();
        RegisterCancelButton = new javax.swing.JButton();
        LoginPanel = new javax.swing.JPanel();
        LoginHeadlineLabel = new javax.swing.JLabel();
        LoginUsernameLabel = new javax.swing.JLabel();
        LoginPasswordLabel = new javax.swing.JLabel();
        LoginUsernameTextField = new javax.swing.JTextField();
        LoginPassTextField = new javax.swing.JPasswordField();
        LoginLogButton = new javax.swing.JButton();
        LoginRegisterCancelButton = new javax.swing.JButton();
        ThreadListPanel = new javax.swing.JPanel();
        ThreadListHeadlineLabel = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        ThreadListList = new javax.swing.JList();
        EnterThreadButton = new javax.swing.JButton();
        ThreadListBackButton = new javax.swing.JButton();
        AddNewThreadButton = new javax.swing.JButton();
        ThreadPanel = new javax.swing.JPanel();
        ThreadTitleLabel = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        ThreadContentLabel = new javax.swing.JLabel();
        RepliesScrollPanel = new javax.swing.JScrollPane();
        RepliesLabel = new javax.swing.JLabel();
        RepliesHeadllineLabel = new javax.swing.JLabel();
        AddReplyButton = new javax.swing.JButton();
        ThreadBackButton = new javax.swing.JButton();
        AddReplyPanel = new javax.swing.JPanel();
        AddReplyHeadlineLabel = new javax.swing.JLabel();
        AddReplyContentLabel = new javax.swing.JLabel();
        AddReplyTextArea = new javax.swing.JTextArea();
        AddReplyAddButton = new javax.swing.JButton();
        AddReplyCancelButton = new javax.swing.JButton();
        AddThreadPanel = new javax.swing.JPanel();
        AddThreadHeadlineLabel = new javax.swing.JLabel();
        AddThreadSubjectLabel = new javax.swing.JLabel();
        AddThreadContentLabel = new javax.swing.JLabel();
        AddThreadSubjectTextField = new javax.swing.JTextField();
        AddThreadContentTextArea = new javax.swing.JTextArea();
        AddThreadCancelButton = new javax.swing.JButton();
        AddThreadAddButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SE-FORUM");
       // CreateSubForumCreateButton.setPreferredSize(new Dimension(40 , 40));
        
        /********************************* Guest Subs ***********************************/
        GuestSubs = new JPanel();
        JLabel label = new JLabel("hi there");
        label.setBounds(100 , 100, 100, 100);
        GuestSubs.add(label);
        
        
        /********************************* Guests Subs *********************************/
        
       // setLocationByPlatform(true);

        /*WelcomePanel.setPreferredSize(new java.awt.Dimension(500, 400));

        welcomeLabel.setFont(new java.awt.Font("Tahoma", 0, 30)); // NOI18N
        welcomeLabel.setText("Welcome to SE Forum Generator");

        GenForumButton.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        GenForumButton.setText("Generate Forum");
        GenForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                GenForumButtonmouseReleased(evt);
            }
        });
        GenForumButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GenForumButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout WelcomePanelLayout = new javax.swing.GroupLayout(WelcomePanel);
        WelcomePanel.setLayout(WelcomePanelLayout);
        WelcomePanelLayout.setHorizontalGroup(
            WelcomePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(WelcomePanelLayout.createSequentialGroup()
                .addGroup(WelcomePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(WelcomePanelLayout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addComponent(welcomeLabel))
                    .addGroup(WelcomePanelLayout.createSequentialGroup()
                        .addGap(175, 175, 175)
                        .addComponent(GenForumButton, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        WelcomePanelLayout.setVerticalGroup(
            WelcomePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(WelcomePanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(welcomeLabel)
                .addGap(85, 85, 85)
                .addComponent(GenForumButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(145, Short.MAX_VALUE))
        );
/*
        GenUserPassPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        welcomeLabel1.setFont(new java.awt.Font("Tahoma", 0, 30)); // NOI18N
        welcomeLabel1.setText("Welcome to SE Forum Generator");
        welcomeLabel1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);

        GenUsernameLabel.setText("Username:");

        GenPassLabel.setText("Password:");

        UserPassButton.setText("Generate Forum");
        UserPassButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                UserPassButtonmouseReleased(evt);
            }
        });

        GenDescLabel.setText("Please choose your SuperAdmin username and Password:");

        javax.swing.GroupLayout GenUserPassPanelLayout = new javax.swing.GroupLayout(GenUserPassPanel);
        GenUserPassPanel.setLayout(GenUserPassPanelLayout);
        GenUserPassPanelLayout.setHorizontalGroup(
            GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, GenUserPassPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(UserPassButton)
                .addGap(189, 189, 189))
            .addGroup(GenUserPassPanelLayout.createSequentialGroup()
                .addGroup(GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(GenUserPassPanelLayout.createSequentialGroup()
                        .addGap(130, 130, 130)
                        .addGroup(GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(GenUsernameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(GenPassLabel))
                        .addGap(18, 18, 18)
                        .addGroup(GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(GenUserTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                            .addComponent(GenPassPassField)))
                    .addGroup(GenUserPassPanelLayout.createSequentialGroup()
                        .addGap(80, 80, 80)
                        .addComponent(GenDescLabel))
                    .addGroup(GenUserPassPanelLayout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addComponent(welcomeLabel1)))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        GenUserPassPanelLayout.setVerticalGroup(
            GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(GenUserPassPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(welcomeLabel1)
                .addGap(18, 18, 18)
                .addComponent(GenDescLabel)
                .addGap(34, 34, 34)
                .addGroup(GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(GenUserTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(GenUsernameLabel))
                .addGap(18, 18, 18)
                .addGroup(GenUserPassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(GenPassLabel)
                    .addComponent(GenPassPassField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(46, 46, 46)
                .addComponent(UserPassButton)
                .addContainerGap(110, Short.MAX_VALUE))
        );
        
        /***************************** Guest Panel ************************************/
        GuestPanel.setPreferredSize(new java.awt.Dimension(500 , 400));
       // GuestPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        RegisterButton.setText("Register");
        RegisterButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                RegisterButtonmouseReleased(evt);
            }
        });
        RegisterButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RegisterButtonActionPerformed(evt);
            }
        });

        LoginButton.setText("Log in");
        LoginButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                LoginButtonmouseReleased(evt);
            }
        });

       /* LogoutButton.setText("Log out");
        LogoutButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                LogoutButtonmouseReleased(evt);
            }
        });*/

        GuestPanelHeadlineLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        GuestPanelHeadlineLabel.setText("SE - Forums");

        ForumsListButton.setText("Forums List");
        ForumsListButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ForumsListButtonmouseReleased(evt);
            }
        });
        ForumsListButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ForumsListButtonActionPerformed(evt);
            }
        });

      /*  CreateForumButton.setText("Create Forum");
        CreateForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateForumButtonmouseReleased(evt);
            }
        });*/

        javax.swing.GroupLayout GuestPanelLayout = new javax.swing.GroupLayout(GuestPanel);
        GuestPanel.setLayout(GuestPanelLayout);
        GuestPanelLayout.setHorizontalGroup(
            GuestPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(GuestPanelLayout.createSequentialGroup()
                .addGap(149, 149, 149)
                .addComponent(GuestPanelHeadlineLabel)
                .addContainerGap(158, Short.MAX_VALUE))
            .addGroup(GuestPanelLayout.createSequentialGroup()
                .addGap(200, 200, 200)
                .addGroup(GuestPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(RegisterButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(LoginButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(ForumsListButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                   /* .addComponent(LogoutButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)*/)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(GuestPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    /*.addComponent(ForumsListButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)*/
                   /* .addComponent(CreateForumButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)*/)
                .addGap(61, 61, 61))
        );
        GuestPanelLayout.setVerticalGroup(
            GuestPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(GuestPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(GuestPanelHeadlineLabel)
                .addGap(64, 64, 64)
                .addGroup(GuestPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                 //   .addComponent(ForumsListButton, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(GuestPanelLayout.createSequentialGroup()
                    	.addComponent(ForumsListButton/*, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE*/)	
                    	.addGap(18, 18, 18)	
                        .addComponent(RegisterButton)
                        .addGap(18, 18, 18)
                        .addComponent(LoginButton)))
                .addGap(18, 18, 18)
                /*.addGroup(GuestPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(LogoutButton)
                    .addComponent(CreateForumButton))*/
                .addContainerGap(127, Short.MAX_VALUE))
        );
        /****************************** Guest Panel **********************************/
        
        /****************************** User Panel ***********************************/
       /* UserPanel.setPreferredSize(new java.awt.Dimension(500 , 400));
        // GuestPanel.setPreferredSize(new java.awt.Dimension(500, 400));

         LogoutButton.setText("Log out");
         LogoutButton.addMouseListener(new java.awt.event.MouseAdapter() {
             public void mouseReleased(java.awt.event.MouseEvent evt) {
                 LogoutButtonmouseReleased(evt);
             }
         });

         UserPanelHeadlineLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
         UserPanelHeadlineLabel.setText("SE - Forums");

         ForumsListButton.setText("Forums List");
         ForumsListButton.addMouseListener(new java.awt.event.MouseAdapter() {
             public void mouseReleased(java.awt.event.MouseEvent evt) {
                 ForumsListButtonmouseReleased(evt);
             }
         });
         ForumsListButton.addActionListener(new java.awt.event.ActionListener() {
             public void actionPerformed(java.awt.event.ActionEvent evt) {
                 ForumsListButtonActionPerformed(evt);
             }
         });

       /*  CreateForumButton.setText("Create Forum");
         CreateForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
             public void mouseReleased(java.awt.event.MouseEvent evt) {
                 CreateForumButtonmouseReleased(evt);
             }
         });

         javax.swing.GroupLayout UserPanelLayout = new javax.swing.GroupLayout(UserPanel);
         UserPanel.setLayout(UserPanelLayout);
         UserPanelLayout.setHorizontalGroup(
             UserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(UserPanelLayout.createSequentialGroup()
                 .addGap(149, 149, 149)
                 .addComponent(UserPanelHeadlineLabel)
                 .addContainerGap(158, Short.MAX_VALUE))
             .addGroup(UserPanelLayout.createSequentialGroup()
                 .addGap(66, 66, 66)
                 .addGroup(UserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                     .addComponent(RegisterButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(LoginButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(ForumsListButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    /* .addComponent(LogoutButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                 /*.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addGroup(UserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)*/
                     /*.addComponent(ForumsListButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)*/
                    /* .addComponent(CreateForumButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                 .addGap(61, 61, 61))
         );
         UserPanelLayout.setVerticalGroup(
             UserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(UserPanelLayout.createSequentialGroup()
                 .addGap(60, 60, 60)
                 .addComponent(UserPanelHeadlineLabel)
                 .addGap(64, 64, 64)
                 .addGroup(UserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  //   .addComponent(ForumsListButton, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                     .addGroup(UserPanelLayout.createSequentialGroup()
                     	.addComponent(ForumsListButton/*, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)	
                     	.addGap(18, 18, 18)	
                         .addComponent(RegisterButton)
                         .addGap(18, 18, 18)
                         .addComponent(LoginButton)))
                 .addGap(18, 18, 18)
                 /*.addGroup(UserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addComponent(LogoutButton)
                     .addComponent(CreateForumButton))
                 .addContainerGap(127, Short.MAX_VALUE))
         );*/
        /****************************** User Panel ***********************************/
        
        ForumsListPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        jLabel1.setText("Forums List");

        /*
        ForumListList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        */
        jScrollPane2.setViewportView(ForumListList);

        EnterForumButton.setText("Enter Forum");
        EnterForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                EnterForumButtonmouseReleased(evt);
            }
        });
        EnterForumButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EnterForumButtonActionPerformed(evt);
            }
        });

        ForumListBackButton.setText("Back");
        ForumListBackButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ForumListBackButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout ForumsListPanelLayout = new javax.swing.GroupLayout(ForumsListPanel);
        ForumsListPanel.setLayout(ForumsListPanelLayout);
        ForumsListPanelLayout.setHorizontalGroup(
            ForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ForumsListPanelLayout.createSequentialGroup()
                .addGroup(ForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ForumsListPanelLayout.createSequentialGroup()
                        .addGap(157, 157, 157)
                        .addComponent(jLabel1))
                    .addGroup(ForumsListPanelLayout.createSequentialGroup()
                        .addGap(163, 163, 163)
                        .addComponent(EnterForumButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ForumListBackButton, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(147, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ForumsListPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(169, 169, 169))
        );
        ForumsListPanelLayout.setVerticalGroup(
            ForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ForumsListPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43)
                .addGroup(ForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EnterForumButton)
                    .addComponent(ForumListBackButton))
                .addContainerGap(65, Short.MAX_VALUE))
        );
        /******************************** SubForumsListPanel *******************************/
        SubForumsListPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        SubForumListLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        SubForumListLabel.setText("SubForums List");

        /*
        SubForumListList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        */
        jScrollPane5.setViewportView(SubForumListList);

        EnterSubForumButton.setText("Enter SubForum");
        EnterSubForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                EnterSubForumButtonmouseReleased(evt);
            }
        });
        EnterSubForumButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EnterSubForumButtonActionPerformed(evt);
            }
        });

        SubForumListLogoutButton.setText("Logout");
        SubForumListLogoutButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                SubForumListLogoutButtonmouseReleased(evt);
            }
        });

        CreateSubForumButton.setText("Create SubForum");
        CreateSubForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateSubForumButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout SubForumsListPanelLayout = new javax.swing.GroupLayout(SubForumsListPanel);
        SubForumsListPanel.setLayout(SubForumsListPanelLayout);
        SubForumsListPanelLayout.setHorizontalGroup(
            SubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SubForumsListPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(169, 169, 169))
            .addGroup(SubForumsListPanelLayout.createSequentialGroup()
                .addGap(130, 130, 130)
                .addGroup(SubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(SubForumsListPanelLayout.createSequentialGroup()
                        .addComponent(SubForumListLabel)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(SubForumsListPanelLayout.createSequentialGroup()
                        .addGap(0, 6, Short.MAX_VALUE)
                        .addComponent(EnterSubForumButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(SubForumListLogoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(139, 139, 139))))
            .addGroup(SubForumsListPanelLayout.createSequentialGroup()
                .addGap(192, 192, 192)
                .addComponent(CreateSubForumButton)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        SubForumsListPanelLayout.setVerticalGroup(
            SubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SubForumsListPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(SubForumListLabel)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CreateSubForumButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(SubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EnterSubForumButton)
                    .addComponent(SubForumListLogoutButton))
                .addContainerGap(63, Short.MAX_VALUE))
        );
        /******************************** SubForumsListPanel *******************************/
        
        /******************************** GuestSubForumsListPanel *******************************/
        GuestSubForumsListPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        GuestSubForumListLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        GuestSubForumListLabel.setText("Sub Forums List");
        
        GuestSubForumsListPanel.add(GuestSubForumListLabel);

        /*
        SubForumListList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });*/
        
        jScrollPane14.setViewportView(GuestSubForumListList);
        GuestSubForumsListPanel.add(jScrollPane14);

        GuestEnterSubForumButton.setText("Enter SubForum");
        GuestEnterSubForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                EnterSubForumButtonmouseReleased(evt);
            }
        });
        GuestEnterSubForumButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EnterSubForumButtonActionPerformed(evt);
            }
        });

        GuestBackButton.setText("Back");
        GuestBackButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                GuestBackButtonmouseReleased(evt);
            }
        });

       /* CreateSubForumButton.setText("Create SubForum");
        CreateSubForumButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateSubForumButtonmouseReleased(evt);
            }
        });*/

        javax.swing.GroupLayout GuestSubForumsListPanelLayout = new javax.swing.GroupLayout(GuestSubForumsListPanel);
        GuestSubForumsListPanel.setLayout(GuestSubForumsListPanelLayout);
        GuestSubForumsListPanelLayout.setHorizontalGroup(
            GuestSubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, GuestSubForumsListPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(169, 169, 169))
            .addGroup(GuestSubForumsListPanelLayout.createSequentialGroup()
                .addGap(130, 130, 130)
                .addGroup(GuestSubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(GuestSubForumsListPanelLayout.createSequentialGroup()
                        .addComponent(GuestSubForumListLabel)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(GuestSubForumsListPanelLayout.createSequentialGroup()
                        .addGap(0, 6, Short.MAX_VALUE)
                        .addComponent(GuestEnterSubForumButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                         .addGap(0, 6, Short.MAX_VALUE)
                        .addComponent(GuestBackButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                       // .addComponent(SubForumListLogoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(139, 139, 139))))
            .addGroup(GuestSubForumsListPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE))
        );
        GuestSubForumsListPanelLayout.setVerticalGroup(
            GuestSubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(GuestSubForumsListPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(GuestSubForumListLabel)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(GuestSubForumsListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(GuestEnterSubForumButton)
                    .addGap(5,5,5)
                    .addComponent(GuestBackButton))
                .addContainerGap(63, Short.MAX_VALUE))
        );
        //GuestSubForumsListPanel.setVisible(true);
        /******************************** GuestSubForumsListPanel *******************************/
        
/*
        CreateForumPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        CreateForumLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        CreateForumLabel.setText("Create Forum");

        ForumNameLabel.setText("Forum name:");

        AdminLabel.setText("Admin:");

        jScrollPane1.setViewportView(AdminList);

        CreateForumCreateButton.setText("Create Forum");
        /*CreateForumCreateButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateForumCreateButtonmouseReleased(evt);
            }
        });
        CreateForumCreateButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateForumCreateButtonmouseReleased(evt);
            }
        });

        CancelButton.setText("Cancel");
        CancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CancelButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout CreateForumPanelLayout = new javax.swing.GroupLayout(CreateForumPanel);
        CreateForumPanel.setLayout(CreateForumPanelLayout);
        CreateForumPanelLayout.setHorizontalGroup(
            CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CreateForumPanelLayout.createSequentialGroup()
                .addGap(120, 120, 120)
                .addGroup(CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(CreateForumLabel)
                    .addGroup(CreateForumPanelLayout.createSequentialGroup()
                        .addComponent(CreateForumCreateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(CancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(CreateForumPanelLayout.createSequentialGroup()
                        .addGroup(CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ForumNameLabel)
                            .addComponent(AdminLabel))
                        .addGap(38, 38, 38)
                        .addGroup(CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(ForumNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(142, Short.MAX_VALUE))
        );
        CreateForumPanelLayout.setVerticalGroup(
            CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CreateForumPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(CreateForumLabel)
                .addGap(30, 30, 30)
                .addGroup(CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ForumNameLabel)
                    .addComponent(ForumNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AdminLabel)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addGroup(CreateForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CreateForumCreateButton)
                    .addComponent(CancelButton))
                .addGap(59, 59, 59))
        );*/

    
        
       
       
        
        CreateForumPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        CreateForumLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        CreateForumLabel.setText("Create Forum");

        ForumNameLabel.setText("Forum name:");

        AdminLabel.setText("Admin:");

        jScrollPane1.setViewportView(AdminList);

        CreateForumCreateButton.setText("Create Forum");
        /*CreateForumCreateButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateForumCreateButtonmouseReleased(evt);
            }
        });*/
        CreateForumCreateButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateForumCreateButtonmouseReleased(evt);
            }
        });

        CancelButton.setText("Cancel");
        CancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CancelButtonmouseReleased(evt);
            }
        });

       
    /******************************* Create SubForum ************************************/
        
        CreateSubForumPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        CreateForumLabel1.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        CreateForumLabel1.setText("Create SubForum");

        SubForumNameLabel.setText("SubForum name:");

        SubAdminLabel.setText("Admin:");

        jScrollPane6.setViewportView(SubAdminList);

        CreateSubForumCreateButton.setText("Create SubForum");
        CreateSubForumCreateButton.setPreferredSize(new Dimension(50 , 50));
        CreateSubForumCreateButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CreateSubForumCreateButtonmouseReleased(evt);
            }
        });

        SubCancelButton.setText("Cancel");
        SubCancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                SubCancelButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout CreateSubForumPanelLayout = new javax.swing.GroupLayout(CreateSubForumPanel);
        CreateSubForumPanel.setLayout(CreateSubForumPanelLayout);
        CreateSubForumPanelLayout.setHorizontalGroup(
            CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CreateSubForumPanelLayout.createSequentialGroup()
                .addGap(125, 125, 125)
                .addGroup(CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(CreateForumLabel1)
                    .addGroup(CreateSubForumPanelLayout.createSequentialGroup()
                        .addGroup(CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(SubForumNameLabel)
                            .addComponent(SubAdminLabel))
                        .addGap(38, 38, 38)
                        .addGroup(CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(SubForumNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(23, 23, 23))
                    .addGroup(CreateSubForumPanelLayout.createSequentialGroup()
                        .addComponent(CreateSubForumCreateButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(SubCancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(98, Short.MAX_VALUE))
        );
        CreateSubForumPanelLayout.setVerticalGroup(
            CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CreateSubForumPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(CreateForumLabel1)
                .addGap(30, 30, 30)
                .addGroup(CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(SubForumNameLabel)
                    .addComponent(SubForumNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(SubAdminLabel)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addGroup(CreateSubForumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CreateSubForumCreateButton)
                    .addComponent(SubCancelButton))
                .addGap(60, 60, 60))
        );
        /******************************* Create SubForum ************************************/
        
        /***************************** Register Panel ****************************/
        RegisterPanel.setOpaque(false);
        RegisterPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        HeadlineRegisterLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        HeadlineRegisterLabel.setText("Register");

        UsernameLabel.setText("Username:");

        PasswordLabel.setText("Password:");
        
        jScrollPane12.setViewportView(ForumsRegList);

        RegisterRegButton.setText("Register");
        RegisterRegButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                RegisterRegButtonmouseReleased(evt);
            }
        });

        RegisterCancelButton.setText("Cancel");
        RegisterCancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                RegisterCancelButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout RegisterPanelLayout = new javax.swing.GroupLayout(RegisterPanel);
        RegisterPanel.setLayout(RegisterPanelLayout);
        RegisterPanelLayout.setHorizontalGroup(
            RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, RegisterPanelLayout.createSequentialGroup()
            	.addGap(110,110,110)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(UsernameLabel)
                    .addComponent(PasswordLabel))
                .addGap(5, 5, 5)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(UsernameTextField)
                    .addComponent(PassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(105, 105, 105))
             .addGroup(RegisterPanelLayout.createSequentialGroup()
            	.addGap(180,180,180)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                		  .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(RegisterPanelLayout.createSequentialGroup()
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(RegisterPanelLayout.createSequentialGroup()
                        .addGap(149, 149, 149)
                        .addComponent(RegisterRegButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(RegisterCancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(RegisterPanelLayout.createSequentialGroup()
                        .addGap(170, 170, 170)
                        .addComponent(HeadlineRegisterLabel)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        RegisterPanelLayout.setVerticalGroup(
            RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(RegisterPanelLayout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(HeadlineRegisterLabel)
                .addGap(20, 20, 20)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(UsernameLabel)
                    .addComponent(UsernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(PasswordLabel)
                    .addComponent(PassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                		 .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                  )
                .addGap(15, 15, 15)
                .addGroup(RegisterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(RegisterRegButton)
                    .addComponent(RegisterCancelButton))
                .addContainerGap(111, Short.MAX_VALUE))
        );
        /***************************** Register Panel ******************************/
        
        /***************************** Login Panel *********************************/
        LoginPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        LoginHeadlineLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        LoginHeadlineLabel.setText("Log in");

        LoginUsernameLabel.setText("Username:");

        LoginPasswordLabel.setText("Password:");
        
        jScrollPane13.setViewportView(ForumsLoginList);

        LoginLogButton.setText("Log in");
        LoginLogButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                LoginLogButtonmouseReleased(evt);
            }
        });

        LoginRegisterCancelButton.setText("Cancel");
        LoginRegisterCancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                LoginRegisterCancelButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout LoginPanelLayout = new javax.swing.GroupLayout(LoginPanel);
        LoginPanel.setLayout(LoginPanelLayout);
        LoginPanelLayout.setHorizontalGroup(
            LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LoginPanelLayout.createSequentialGroup()
                .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(LoginPanelLayout.createSequentialGroup()
                        .addGap(180, 180, 180)
                        .addComponent(LoginHeadlineLabel))
                    .addGroup(LoginPanelLayout.createSequentialGroup()
                        .addGap(110, 110, 110)
                        .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(LoginUsernameLabel)
                            .addComponent(LoginPasswordLabel))
                        .addGap(5, 5, 5)
                        .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(LoginUsernameTextField)
                            .addComponent(LoginPassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(180 , 180 , 180)
                    .addGroup(RegisterPanelLayout.createSequentialGroup()
            	.addGap(180,180,180)
                .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                		  .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                   .addGroup(LoginPanelLayout.createSequentialGroup()
                        .addGap(160, 160, 160)
                        .addComponent(LoginLogButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(LoginRegisterCancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(118, Short.MAX_VALUE))
        );
        LoginPanelLayout.setVerticalGroup(
            LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LoginPanelLayout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(LoginHeadlineLabel)
                .addGap(20, 20, 20)
                .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LoginUsernameLabel)
                    .addComponent(LoginUsernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LoginPasswordLabel)
                    .addComponent(LoginPassTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                 .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                		 .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                  )
                 .addGap(15,15,15)
                .addGroup(LoginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LoginLogButton)
                    .addComponent(LoginRegisterCancelButton))
                .addContainerGap(107, Short.MAX_VALUE))
        );
        /******************************* Login Panel ****************************************/
        ThreadListPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        ThreadListHeadlineLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        ThreadListHeadlineLabel.setText("Thread List");

        jScrollPane3.setViewportView(ThreadListList);

        EnterThreadButton.setText("Enter Thread");
        EnterThreadButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                EnterThreadButtonmouseReleased(evt);
            }
        });
        EnterThreadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EnterThreadButtonActionPerformed(evt);
            }
        });

        ThreadListBackButton.setText("Back");
        ThreadListBackButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ThreadListBackButtonmouseReleased(evt);
            }
        });

        AddNewThreadButton.setText("Add New Thread");
        AddNewThreadButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                AddNewThreadButtonmouseReleased(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                AddNewThreadButtonMouseEntered(evt);
            }
        });

        javax.swing.GroupLayout ThreadListPanelLayout = new javax.swing.GroupLayout(ThreadListPanel);
        ThreadListPanel.setLayout(ThreadListPanelLayout);
        ThreadListPanelLayout.setHorizontalGroup(
            ThreadListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ThreadListPanelLayout.createSequentialGroup()
                .addGroup(ThreadListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ThreadListPanelLayout.createSequentialGroup()
                        .addGap(182, 182, 182)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(ThreadListPanelLayout.createSequentialGroup()
                        .addGap(160, 160, 160)
                        .addGroup(ThreadListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(ThreadListPanelLayout.createSequentialGroup()
                                .addComponent(EnterThreadButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(ThreadListBackButton, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(ThreadListHeadlineLabel))))
                .addContainerGap(146, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ThreadListPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(AddNewThreadButton)
                .addGap(187, 187, 187))
        );
        ThreadListPanelLayout.setVerticalGroup(
            ThreadListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ThreadListPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(ThreadListHeadlineLabel)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(AddNewThreadButton)
                .addGap(21, 21, 21)
                .addGroup(ThreadListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EnterThreadButton)
                    .addComponent(ThreadListBackButton))
                .addContainerGap(61, Short.MAX_VALUE))
        );

        ThreadPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        ThreadTitleLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        ThreadTitleLabel.setText("Thread ");

        ThreadContentLabel.setText("jLabel6");
        jScrollPane4.setViewportView(ThreadContentLabel);

        RepliesLabel.setText("jLabel5");
        RepliesScrollPanel.setViewportView(RepliesLabel);

        RepliesHeadllineLabel.setText("Replies:");

        AddReplyButton.setText("Add Reply");
        AddReplyButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                AddReplyButtonmouseReleased(evt);
            }
        });

        ThreadBackButton.setText("Back");
        ThreadBackButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ThreadBackButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout ThreadPanelLayout = new javax.swing.GroupLayout(ThreadPanel);
        ThreadPanel.setLayout(ThreadPanelLayout);
        ThreadPanelLayout.setHorizontalGroup(
            ThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ThreadPanelLayout.createSequentialGroup()
                .addGap(189, 189, 189)
                .addComponent(ThreadTitleLabel)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ThreadPanelLayout.createSequentialGroup()
                .addGap(0, 141, Short.MAX_VALUE)
                .addGroup(ThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ThreadPanelLayout.createSequentialGroup()
                        .addGroup(ThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(RepliesScrollPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(135, 135, 135))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ThreadPanelLayout.createSequentialGroup()
                        .addComponent(RepliesHeadllineLabel)
                        .addGap(229, 229, 229))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ThreadPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(AddReplyButton)
                .addGap(18, 18, 18)
                .addComponent(ThreadBackButton, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(160, 160, 160))
        );
        ThreadPanelLayout.setVerticalGroup(
            ThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ThreadPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(ThreadTitleLabel)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(RepliesHeadllineLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(RepliesScrollPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(ThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddReplyButton)
                    .addComponent(ThreadBackButton))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        AddReplyPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        AddReplyHeadlineLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        AddReplyHeadlineLabel.setText("Add Reply");

        AddReplyContentLabel.setText("Content:");

        AddReplyAddButton.setText("Add Reply");
        AddReplyAddButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                AddReplyAddButtonmouseReleased(evt);
            }
        });
        AddReplyAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddReplyAddButtonActionPerformed(evt);
            }
        });

        AddReplyCancelButton.setText("Cancel");
        AddReplyCancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                AddReplyCancelButtonmouseReleased(evt);
            }
        });
        AddReplyCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddReplyCancelButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout AddReplyPanelLayout = new javax.swing.GroupLayout(AddReplyPanel);
        AddReplyPanel.setLayout(AddReplyPanelLayout);
        AddReplyPanelLayout.setHorizontalGroup(
            AddReplyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AddReplyPanelLayout.createSequentialGroup()
                .addGap(102, 102, 102)
                .addComponent(AddReplyContentLabel)
                .addGap(18, 18, 18)
                .addComponent(AddReplyTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(129, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, AddReplyPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(AddReplyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, AddReplyPanelLayout.createSequentialGroup()
                        .addComponent(AddReplyHeadlineLabel)
                        .addGap(165, 165, 165))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, AddReplyPanelLayout.createSequentialGroup()
                        .addComponent(AddReplyAddButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(AddReplyCancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(158, 158, 158))))
        );
        AddReplyPanelLayout.setVerticalGroup(
            AddReplyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AddReplyPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(AddReplyHeadlineLabel)
                .addGap(30, 30, 30)
                .addGroup(AddReplyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AddReplyContentLabel)
                    .addComponent(AddReplyTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(45, 45, 45)
                .addGroup(AddReplyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddReplyAddButton)
                    .addComponent(AddReplyCancelButton))
                .addContainerGap(73, Short.MAX_VALUE))
        );

        AddThreadPanel.setPreferredSize(new java.awt.Dimension(500, 400));

        AddThreadHeadlineLabel.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        AddThreadHeadlineLabel.setText("Add Thread");

        AddThreadSubjectLabel.setText("Subject:");

        AddThreadContentLabel.setText("Content:");

        AddThreadCancelButton.setText("Cancel");
        AddThreadCancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                AddThreadCancelButtonmouseReleased(evt);
            }
        });
        AddThreadCancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddThreadCancelButtonActionPerformed(evt);
            }
        });

        AddThreadAddButton.setText("Add Thread");
        AddThreadAddButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                AddThreadAddButtonmouseReleased(evt);
            }
        });

        javax.swing.GroupLayout AddThreadPanelLayout = new javax.swing.GroupLayout(AddThreadPanel);
        AddThreadPanel.setLayout(AddThreadPanelLayout);
        AddThreadPanelLayout.setHorizontalGroup(
            AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AddThreadPanelLayout.createSequentialGroup()
                .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(AddThreadPanelLayout.createSequentialGroup()
                        .addGap(157, 157, 157)
                        .addComponent(AddThreadHeadlineLabel))
                    .addGroup(AddThreadPanelLayout.createSequentialGroup()
                        .addGap(95, 95, 95)
                        .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(AddThreadSubjectLabel)
                            .addComponent(AddThreadContentLabel))
                        .addGap(32, 32, 32)
                        .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(AddThreadPanelLayout.createSequentialGroup()
                                .addComponent(AddThreadAddButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(AddThreadCancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(AddThreadSubjectTextField)
                                .addComponent(AddThreadContentTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(113, Short.MAX_VALUE))
        );
        AddThreadPanelLayout.setVerticalGroup(
            AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AddThreadPanelLayout.createSequentialGroup()
                .addGap(60, 60, 60)
                .addComponent(AddThreadHeadlineLabel)
                .addGap(33, 33, 33)
                .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AddThreadSubjectTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(AddThreadSubjectLabel))
                .addGap(18, 18, 18)
                .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AddThreadContentTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(AddThreadContentLabel))
                .addGap(33, 33, 33)
                .addGroup(AddThreadPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddThreadAddButton)
                    .addComponent(AddThreadCancelButton))
                .addContainerGap(50, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 520, Short.MAX_VALUE)
           /* .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(WelcomePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(GenUserPassPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))*/
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(GuestPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
             .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(GuestSubForumsListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(ForumsListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
           /* .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(UserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))*/
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(CreateForumPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(RegisterPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(LoginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(ThreadListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(ThreadPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(AddReplyPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 10, Short.MAX_VALUE)
                    .addComponent(AddThreadPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 10, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(SubForumsListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(CreateSubForumPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 422, Short.MAX_VALUE)
            /*.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(WelcomePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))*/
            /*.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(GenUserPassPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))*/
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(GuestPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(GuestSubForumsListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(ForumsListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            /*.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(UserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))*/
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(CreateForumPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(RegisterPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(LoginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(ThreadListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(ThreadPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(AddReplyPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 11, Short.MAX_VALUE)
                    .addComponent(AddThreadPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 11, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(SubForumsListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(CreateSubForumPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(12, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void GenForumButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_GenForumButtonmouseReleased
        WelcomePanel.setVisible(false);
        GenUserPassPanel.setVisible(true);
    }//GEN-LAST:event_GenForumButtonmouseReleased

    private void GenForumButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GenForumButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_GenForumButtonActionPerformed

    private void UserPassButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_UserPassButtonmouseReleased
         try {
            String user = GenUserTextField.getText();
            String pass = GenPassPassField.getText();
                        
           if (user.compareTo("")==0 || pass.compareTo("")==0)
           {
                JOptionPane.showMessageDialog(this,
                "Please choose username and password !",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
           }
            else
           {
               messages.initForum(user, pass);
               GenUserPassPanel.setVisible(false);
               GuestPanel.setVisible(true);
           }
        } catch (IOException ex) {
            popupError("Lost connection with the server !");
        }

    }//GEN-LAST:event_UserPassButtonmouseReleased

    private void RegisterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RegisterButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_RegisterButtonActionPerformed

    private void ForumsListButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ForumsListButtonmouseReleased
        GuestPanel.setVisible(false);
        ForumsListPanel.setVisible(true);
        
       try {
            serverAns = messages.showForums().trim().split(Strings.DELIMITER);
           
            } 
        catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
        final String strings2[] = new String[serverAns.length];
        int i = 0;
        for (int j=1; j<serverAns.length; j=j+2)
        {
             strings2[i] = serverAns[j] + "\0" + serverAns[j+1];
             i++;
             //System.out.println(strings2[i-1]);
        }
       
        ForumListList.setModel(new javax.swing.AbstractListModel() {
            String strings[] = strings2;
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }

        });
        
    }//GEN-LAST:event_ForumsListButtonmouseReleased

    private void EnterForumButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EnterForumButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_EnterForumButtonActionPerformed

    private void ForumsListButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ForumsListButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ForumsListButtonActionPerformed

    private void CreateForumButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CreateForumButtonmouseReleased
       GuestPanel.setVisible(false);
       CreateForumPanel.setVisible(true);
       
        try {
            serverAns = messages.showForumUsers(forumID).trim().split(Strings.DELIMITER);
            } 
        catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
        final String strings2[] = new String[serverAns.length-1];
        int j = 0;
        for (int i=1; i<serverAns.length; i=i+2)
        {
            strings2[j] = serverAns[i] + "\0" + serverAns[i+1];
            j++;
        }
       
        AdminList.setModel(new javax.swing.AbstractListModel() {
            String strings[] = strings2;
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }

        });
       
    }//GEN-LAST:event_CreateForumButtonmouseReleased

    private void CancelButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CancelButtonmouseReleased
       CreateForumPanel.setVisible(false);      
       GuestPanel.setVisible(true);
    }//GEN-LAST:event_CancelButtonmouseReleased

    private void RegisterButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RegisterButtonmouseReleased    
       try {
           serverAns = messages.showForums().trim().split(Strings.DELIMITER);
           } 
       catch (IOException ex) {
           popupError("Lost connection with the server !");
       }
       final String strings2[] = new String[serverAns.length-1];
       int i = 1;
       for (int j=1; j<serverAns.length; j=j+2)
       {
           strings2[i-1] = serverAns[j] + "\0" + serverAns[j+1];
           i++;
       }
     
       ForumsRegList.setModel(new javax.swing.AbstractListModel() {
           String strings[] = strings2;
           public int getSize() { return strings.length; }
           public Object getElementAt(int i) { return strings[i]; }

       });
       GuestPanel.setVisible(false);
       RegisterPanel.setVisible(true);
    }//GEN-LAST:event_RegisterButtonmouseReleased

    private void RegisterCancelButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RegisterCancelButtonmouseReleased
       RegisterPanel.setVisible(false);
       GuestPanel.setVisible(true);
    }//GEN-LAST:event_RegisterCancelButtonmouseReleased

    private void LoginRegisterCancelButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LoginRegisterCancelButtonmouseReleased
       LoginPanel.setVisible(false);
       GuestPanel.setVisible(true);
    }//GEN-LAST:event_LoginRegisterCancelButtonmouseReleased

    private void LoginButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LoginButtonmouseReleased
       GuestPanel.setVisible(false);
       LoginPanel.setVisible(true);
       
       try {
           serverAns = messages.showForums().trim().split(Strings.DELIMITER);
           } 
       catch (IOException ex) {
           popupError("Lost connection with the server !");
       }
       final String strings2[] = new String[serverAns.length-1];
       int i = 1;
       for (int j=1; j<serverAns.length; j=j+2)
       {
           strings2[i-1] = serverAns[j] + "\0" + serverAns[j+1];
           i++;
       }
      
       ForumsLoginList.setModel(new javax.swing.AbstractListModel() {
           String strings[] = strings2;
           public int getSize() { return strings.length; }
           public Object getElementAt(int i) { return strings[i]; }

       });

    }//GEN-LAST:event_LoginButtonmouseReleased

    private void ForumListBackButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ForumListBackButtonmouseReleased
        ForumsListPanel.setVisible(false); 
        GuestPanel.setVisible(true);
      
    }//GEN-LAST:event_ForumListBackButtonmouseReleased

    private void EnterThreadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EnterThreadButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_EnterThreadButtonActionPerformed

    private void ThreadListBackButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ThreadListBackButtonmouseReleased
        ThreadListPanel.setVisible(false); 
        SubForumsListPanel.setVisible(true);
    }//GEN-LAST:event_ThreadListBackButtonmouseReleased

    private void EnterForumButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EnterForumButtonmouseReleased
        Object selected = ForumListList.getSelectedValue();
        if (selected == null)
        {
            JOptionPane.showMessageDialog(this,
           "Please choose forum !",
           "SE-FORUM",
           JOptionPane.WARNING_MESSAGE);
        }
        else
        {  
            forumID = ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
            try {
                serverAns = messages.showForum(forumID).trim().split(Strings.DELIMITER);
                } 
            catch (IOException ex) {
                popupError("Lost connection with the server !");
            }
            final String strings2[] = new String[serverAns.length];
            int j = 0;
            for (int i=1; i<serverAns.length; i=i+2)
            {	
                  strings2[j] = serverAns[i] + "\0" + serverAns[i+1];
                  j++;
            }
            GuestSubForumListList.setModel(new javax.swing.AbstractListModel() {
                String strings[] = strings2;
                public int getSize() { return strings.length; }
                public Object getElementAt(int i) { return strings[i]; }

            });
            ForumsListPanel.setVisible(false); 
            GuestSubForumsListPanel.setVisible(true); 
            //GuestSubForumsListPanel.getComponents();
          
        }

    }//GEN-LAST:event_EnterForumButtonmouseReleased

    private void ThreadBackButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ThreadBackButtonmouseReleased
        ThreadPanel.setVisible(false);
        ThreadListPanel.setVisible(true);

    }//GEN-LAST:event_ThreadBackButtonmouseReleased

    private void AddReplyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddReplyCancelButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_AddReplyCancelButtonActionPerformed

    private void AddReplyButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddReplyButtonmouseReleased
        ThreadPanel.setVisible(false);
        AddReplyPanel.setVisible(true);
    }//GEN-LAST:event_AddReplyButtonmouseReleased

    private void AddReplyCancelButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddReplyCancelButtonmouseReleased
        AddReplyPanel.setVisible(false);
        ThreadPanel.setVisible(true);
    }//GEN-LAST:event_AddReplyCancelButtonmouseReleased

    private void EnterThreadButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EnterThreadButtonmouseReleased
        Object selected = ThreadListList.getSelectedValue();
        if (selected == null)
        {
            JOptionPane.showMessageDialog(this,
           "Please choose thread !",
           "SE-FORUM",
           JOptionPane.WARNING_MESSAGE);
        }
        else
        {  
            postID = ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
            try {
                serverAns = messages.showPost(postID).split(Strings.DELIMITER);
                for (int k = 0; k<serverAns.length; k++)
                	System.out.println(serverAns[k]);
                } 
            catch (IOException ex) {
                popupError("Lost connection with the server !");
            }
            if(serverAns[0].trim().compareTo(Strings.ANS_SHOW_MESSAGES)==0)
               {
                    //String postTitle = serverAns[1].substring(0,  serverAns[1].indexOf(Strings.DELIMITER)).trim();
                    String postContent = serverAns[1].substring(serverAns[1].indexOf(Strings.DELIMITER) + 1, serverAns[1].length()).trim();
                    String Replies = serverAns[2];
                    for (int i=3; i< serverAns.length; i++)
                    {
                        Replies += serverAns[i]  + "\n";
                    }
                    // ThreadTitleLabel.setText(postTitle);
                    ThreadContentLabel.setText(postContent);
                    RepliesLabel.setText(Replies);
                    ThreadListPanel.setVisible(false);        
                    ThreadPanel.setVisible(true);
               }
               else
               {
                    JOptionPane.showMessageDialog(this,
                    serverAns[1].trim(),
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
               }           

        }
    }//GEN-LAST:event_EnterThreadButtonmouseReleased

    private void AddThreadCancelButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddThreadCancelButtonmouseReleased
        AddThreadPanel.setVisible(false);
        ThreadListPanel.setVisible(true);

    }//GEN-LAST:event_AddThreadCancelButtonmouseReleased

    private void AddThreadCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddThreadCancelButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_AddThreadCancelButtonActionPerformed

    private void AddNewThreadButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddNewThreadButtonmouseReleased
        ThreadListPanel.setVisible(false);
        AddThreadPanel.setVisible(true);
    }//GEN-LAST:event_AddNewThreadButtonmouseReleased

    private void CreateForumCreateButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CreateForumCreateButtonmouseReleased
        try {
            String forumName = ForumNameTextField.getText();
            Object selected = AdminList.getSelectedValue();
            
           if (forumName.compareTo("")==0 || selected == null)
           {
                JOptionPane.showMessageDialog(this,
                "Please choose forum name and admin!",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
           }
            else
           {
               String forumAdmin = ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
               serverAns = messages.addForum(forumName, forumAdmin).split(Strings.DELIMITER);
               
               if(serverAns[0].trim().compareTo(Strings.FORUM_ADDED)==0)
               {
                    JOptionPane.showMessageDialog(this,
                    "Forum: " + forumName + " successfully created",
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
                   CreateForumPanel.setVisible(false);
                   GuestPanel.setVisible(true);
               }
               else
               {
                    JOptionPane.showMessageDialog(this,
                    serverAns[1].trim(),
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
               }                  
           }
        } catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
        ForumNameTextField.setText("");
    }//GEN-LAST:event_CreateForumCreateButtonmouseReleased

    private void RegisterRegButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RegisterRegButtonmouseReleased
        try {
        	Object selected = ForumsRegList.getSelectedValue();
        	String user = UsernameTextField.getText();
            String pass = PassTextField.getText();
                        
           if (user.compareTo("")==0 || pass.compareTo("")==0 || selected == null)
           {
                JOptionPane.showMessageDialog(this,
                "Please choose username and password !",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
           }
            else
           {
               String forum =  ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
               serverAns = messages.register(user, pass , forum).split(Strings.DELIMITER);
               System.out.println(serverAns[0].trim());
               if(serverAns[0].trim().compareTo(Strings.REGISTERED)==0)
               {
                    userID = serverAns[1].trim();
                    login = false;
                    RegisterPanel.setVisible(false);
                    GuestPanel.setVisible(true);
               }
               else
               {
                JOptionPane.showMessageDialog(this,
                serverAns[1].trim(),
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
               }

           }
        } catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
         UsernameTextField.setText("");
         PassTextField.setText("");
    }//GEN-LAST:event_RegisterRegButtonmouseReleased

    private void LoginLogButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LoginLogButtonmouseReleased
        Object selected = ForumsLoginList.getSelectedValue();
		String user = LoginUsernameTextField.getText();
		String pass = LoginPassTextField.getText();
		String forum = null;     
         if (user.compareTo("")==0 || pass.compareTo("")==0 || selected == null)
         {
		    JOptionPane.showMessageDialog(this,
		    "Please enter username and password !",
		    "SE-FORUM",
		    JOptionPane.WARNING_MESSAGE);
         }
         else
         {
         forum = ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
         forumID = forum;
        	 try {
				serverAns = messages.login(user,pass,forumID).trim().split(Strings.DELIMITER);
			} catch (IOException e) {
				 popupError("Lost connection with the server !");
			}
        	 if(serverAns[0].trim().compareTo(Strings.LOGGED_IN)==0)
             {
                  userID = serverAns[1].trim();
                  login = true;
                  try {
           		   serverAns = messages.showForum(forumID).trim().split(Strings.DELIMITER);
           		   } 
                    catch (IOException ex) {
           		   popupError("Lost connection with the server !");
                    }
                    final String strings2[] = new String[serverAns.length];
                    int j = 0;
                    for (int i=1; i<serverAns.length; i=i+2)
                    {	
           		     strings2[j] = serverAns[i] + "\0" + serverAns[i+1];
           		     j++;
                    }
                    SubForumListList.setModel(new javax.swing.AbstractListModel() {
           		   String strings[] = strings2;
           		   public int getSize() { return strings.length; }
           		   public Object getElementAt(int i) { return strings[i]; }

                    });
                    LoginPanel.setVisible(false); 
                    SubForumsListPanel.setVisible(true);
             }
             else
             {
              JOptionPane.showMessageDialog(this,
              serverAns[1].trim(),
              "SE-FORUM",
              JOptionPane.WARNING_MESSAGE);
             }
         }
        LoginUsernameTextField.setText("");
        LoginPassTextField.setText("");
    }//GEN-LAST:event_LoginLogButtonmouseReleased

    private void LogoutButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LogoutButtonmouseReleased

        
        try {                       
            serverAns = messages.logout().split(Strings.DELIMITER);
            if(serverAns[0].trim().compareTo(Strings.LOGGED_OUT)==0)
            {
            	  forumID = null;
                  userID = null;
                  login = false;
                    JOptionPane.showMessageDialog(this,
                "Logged out successfully",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
            }
            else
            {
             JOptionPane.showMessageDialog(this,
             serverAns[1].trim(),
             "SE-FORUM",
             JOptionPane.WARNING_MESSAGE);
            }

        } 
        catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
    }//GEN-LAST:event_LogoutButtonmouseReleased

    private void AddThreadAddButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddThreadAddButtonmouseReleased
         try {
            String subject = AddThreadSubjectTextField.getText();
            String content = AddThreadContentTextArea.getText();
            
           if (subject.isEmpty() || content.isEmpty())
           {
                JOptionPane.showMessageDialog(this,
                "Please fill in subject and  content !",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
           }
            else
           {
               serverAns = messages.newMessage(subject, content, subforumID).split(Strings.DELIMITER);
               if(serverAns[0].trim().compareTo(Strings.TOPIC_ADDED)==0)
               {
                    JOptionPane.showMessageDialog(this,
                    "Thread: " + subject + " successfully created",
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
                   AddThreadPanel.setVisible(false);
                   SubForumsListPanel.setVisible(true);
               }
               else
               {
                    JOptionPane.showMessageDialog(this,
                    serverAns[1].trim(),
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
               }                  
           }
        } catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
         AddThreadSubjectTextField.setText("");   
         AddThreadContentTextArea.setText(""); 
    }//GEN-LAST:event_AddThreadAddButtonmouseReleased

    private void AddReplyAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddReplyAddButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_AddReplyAddButtonActionPerformed

    private void AddReplyAddButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddReplyAddButtonmouseReleased
       try {
            String content = AddReplyTextArea.getText();
            
           if (content.isEmpty())
           {
                JOptionPane.showMessageDialog(this,
                "Please fill in repliy content !",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
           }
            else
           {
               content = content + "\n";
               serverAns = messages.newReply(content, postID).split(Strings.DELIMITER);
               if(serverAns[0].trim().compareTo(Strings.REPLY_ADDED)==0)
               {
                    JOptionPane.showMessageDialog(this,
                    "Reply successfully created",
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
                   AddReplyPanel.setVisible(false);
                   ThreadListPanel.setVisible(true);
               }
               else
               {
                    JOptionPane.showMessageDialog(this,
                    serverAns[1].trim(),
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
               }                  
           }
        } catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
       AddReplyTextArea.setText("");
    }//GEN-LAST:event_AddReplyAddButtonmouseReleased

    private void AddNewThreadButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_AddNewThreadButtonMouseEntered
        // TODO add your handling code here:
    }//GEN-LAST:event_AddNewThreadButtonMouseEntered

    private void EnterSubForumButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_EnterSubForumButtonmouseReleased
        Object selected = SubForumListList.getSelectedValue();
        if (selected == null)
        {
            JOptionPane.showMessageDialog(this,
           "Please choose subforum !",
           "SE-FORUM",
           JOptionPane.WARNING_MESSAGE);
        }
        else
        {  
            subforumID = ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
            try {
                serverAns = messages.showSubForum(subforumID).trim().split(Strings.DELIMITER);

                } 
            catch (IOException ex) {
                popupError("Lost connection with the server !");
            }
            final String strings2[] = new String[serverAns.length];
            int j = 0;
            for (int i=1; i<serverAns.length; i=i+2)
            {
                  strings2[j] = serverAns[i] + "\0" + serverAns[i+1];
                  j++;
            }
            ThreadListList.setModel(new javax.swing.AbstractListModel() {
                String strings[] = strings2;
                public int getSize() { return strings.length; }
                public Object getElementAt(int i) { return strings[i]; }

            });
            SubForumsListPanel.setVisible(false); 
            ThreadListPanel.setVisible(true); 
        }

    }//GEN-LAST:event_EnterSubForumButtonmouseReleased

    private void EnterSubForumButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EnterSubForumButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_EnterSubForumButtonActionPerformed

    private void SubForumListLogoutButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SubForumListLogoutButtonmouseReleased
        
    	 try {                       
             serverAns = messages.logout().split(Strings.DELIMITER);
             if(serverAns[0].trim().compareTo(Strings.LOGGED_OUT)==0)
             {
            	
                 userID = null;
                 login = false;
                 JOptionPane.showMessageDialog(this,
                 "Logged out successfully",
                 "SE-FORUM",
                 JOptionPane.WARNING_MESSAGE);
             }
            
             else
             {
              JOptionPane.showMessageDialog(this,
              serverAns[1].trim(),
              "SE-FORUM",
              JOptionPane.WARNING_MESSAGE);
             }

         } 
         catch (IOException ex) {
             popupError("Lost connection with the server !");
         }
    	
    	SubForumsListPanel.setVisible(false); 
        GuestPanel.setVisible(true);
    }//GEN-LAST:event_SubForumListLogoutButtonmouseReleased

    private void CreateSubForumCreateButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CreateSubForumCreateButtonmouseReleased
         
    	try {
            String subforumName = SubForumNameTextField.getText();
            Object selected = SubAdminList.getSelectedValue();
            
           if (subforumName.compareTo("")==0 || selected == null)
           {
                JOptionPane.showMessageDialog(this,
                "Please choose subforum name and admin!",
                "SE-FORUM",
                JOptionPane.WARNING_MESSAGE);
           }
            else
           {
               String forumAdmin = ((String)selected).substring(((String)selected).indexOf(Strings.DELIMITER) + 1, ((String)selected).length()).trim();
               serverAns = messages.newsubforum(subforumName, forumID ,forumAdmin).split(Strings.DELIMITER);
               System.out.println(subforumName+" "+forumID+" "+forumAdmin);
               System.out.println(serverAns[0]);
               if(serverAns[0].trim().compareTo(Strings.SUBFORUM_ADDED)==0)
               {
                    JOptionPane.showMessageDialog(this,
                    "SubForum: " + subforumName + " successfully created",
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
                    CreateSubForumPanel.setVisible(false);
                    ThreadListPanel.setVisible(true);
                    
                    try {
                		   serverAns = messages.showForum(forumID).trim().split(Strings.DELIMITER);
                		   } 
                         catch (IOException ex) {
                		   popupError("Lost connection with the server !");
                         }
                         final String strings2[] = new String[serverAns.length];
                         int j = 0;
                         for (int i=1; i<serverAns.length; i=i+2)
                         {	
                		     strings2[j] = serverAns[i] + "\0" + serverAns[i+1];
                		     j++;
                         }
                         SubForumListList.setModel(new javax.swing.AbstractListModel() {
                		   String strings[] = strings2;
                		   public int getSize() { return strings.length; }
                		   public Object getElementAt(int i) { return strings[i]; }

                         });
               }
               else
               {
                    JOptionPane.showMessageDialog(this,
                    serverAns[1].trim(),
                    "SE-FORUM",
                    JOptionPane.WARNING_MESSAGE);
               }                  
           }
        } catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
        SubForumNameTextField.setText("");
        
        
    }//GEN-LAST:event_CreateSubForumCreateButtonmouseReleased

    private void SubCancelButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SubCancelButtonmouseReleased
        CreateSubForumPanel.setVisible(false);
        SubForumsListPanel.setVisible(true);
    }//GEN-LAST:event_SubCancelButtonmouseReleased

    private void GuestBackButtonmouseReleased(java.awt.event.MouseEvent ewt)
    {
    	GuestSubForumsListPanel.setVisible(false);
    	ForumsListPanel.setVisible(true);
    }
    
    private void CreateSubForumButtonmouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CreateSubForumButtonmouseReleased
        SubForumsListPanel.setVisible(false);
        CreateSubForumPanel.setVisible(true);
       
        try {
            serverAns = messages.showForumUsers(forumID).trim().split(Strings.DELIMITER);
            System.out.println(serverAns[0]);
            } 
        catch (IOException ex) {
            popupError("Lost connection with the server !");
        }
        final String strings2[] = new String[serverAns.length];
        int i = 0;
        for (int j=1; j<serverAns.length; j=j+2)
        {
            strings2[i] = serverAns[j] +"\0"+ serverAns[j+1];
            i++;
        }
        SubAdminList.setModel(new javax.swing.AbstractListModel() {
            String strings[] = strings2;
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }

        });
    }//GEN-LAST:event_CreateSubForumButtonmouseReleased

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddNewThreadButton;
    private javax.swing.JButton AddReplyAddButton;
    private javax.swing.JButton AddReplyButton;
    private javax.swing.JButton AddReplyCancelButton;
    private javax.swing.JLabel AddReplyContentLabel;
    private javax.swing.JLabel AddReplyHeadlineLabel;
    private javax.swing.JPanel AddReplyPanel;
    private javax.swing.JTextArea AddReplyTextArea;
    private javax.swing.JButton AddThreadAddButton;
    private javax.swing.JButton AddThreadCancelButton;
    private javax.swing.JLabel AddThreadContentLabel;
    private javax.swing.JTextArea AddThreadContentTextArea;
    private javax.swing.JLabel AddThreadHeadlineLabel;
    private javax.swing.JPanel AddThreadPanel;
    private javax.swing.JLabel AddThreadSubjectLabel;
    private javax.swing.JTextField AddThreadSubjectTextField;
    private javax.swing.JLabel AdminLabel;
    private javax.swing.JList AdminList;
    private javax.swing.JButton CancelButton;
    private javax.swing.JButton CreateForumButton;
    private javax.swing.JButton CreateForumCreateButton;
    private javax.swing.JLabel CreateForumLabel;
    private javax.swing.JLabel CreateForumLabel1;
    private javax.swing.JPanel CreateForumPanel;
    private javax.swing.JButton CreateSubForumButton;
    private javax.swing.JButton CreateSubForumCreateButton;
    private javax.swing.JPanel CreateSubForumPanel;
    private javax.swing.JButton EnterForumButton;
    private javax.swing.JButton EnterSubForumButton;
    private javax.swing.JButton EnterThreadButton;
    private javax.swing.JButton ForumListBackButton;
    private javax.swing.JList ForumListList;
    private javax.swing.JList ForumsLoginList;
    private javax.swing.JLabel ForumNameLabel;
    private javax.swing.JTextField ForumNameTextField;
    private javax.swing.JButton ForumsListButton;
    private javax.swing.JPanel ForumsListPanel;
    private javax.swing.JLabel GenDescLabel;
    private javax.swing.JButton GenForumButton;
    private javax.swing.JLabel GenPassLabel;
    private javax.swing.JPasswordField GenPassPassField;
    private javax.swing.JPanel GenUserPassPanel;
    private javax.swing.JTextField GenUserTextField;
    private javax.swing.JLabel GenUsernameLabel;
    private javax.swing.JLabel HeadlineRegisterLabel;
    private javax.swing.JButton LoginButton;
    private javax.swing.JLabel LoginHeadlineLabel;
    private javax.swing.JButton LoginLogButton;
    private javax.swing.JPanel LoginPanel;
    private javax.swing.JPasswordField LoginPassTextField;
    private javax.swing.JLabel LoginPasswordLabel;
    private javax.swing.JButton LoginRegisterCancelButton;
    private javax.swing.JLabel LoginUsernameLabel;
    private javax.swing.JTextField LoginUsernameTextField;
    private javax.swing.JButton LogoutButton;
    private javax.swing.JLabel UserPanelHeadlineLabel;
    private javax.swing.JButton GuestEnterSubForumButton;
    private javax.swing.JLabel GuestPanelHeadlineLabel;
    private javax.swing.JPanel GuestPanel;
   // private javax.swing.JPanel UserPanel;
    private javax.swing.JPasswordField PassTextField;
    private javax.swing.JLabel PasswordLabel;
    private javax.swing.JButton RegisterButton;
    private javax.swing.JButton RegisterCancelButton;
    private javax.swing.JPanel RegisterPanel;
    private javax.swing.JList ForumsRegList;
    private javax.swing.JButton RegisterRegButton;
    private javax.swing.JLabel RepliesHeadllineLabel;
    private javax.swing.JLabel RepliesLabel;
    private javax.swing.JScrollPane RepliesScrollPanel;
    private javax.swing.JLabel SubAdminLabel;
    private javax.swing.JList SubAdminList;
    private javax.swing.JButton SubCancelButton;
    private javax.swing.JButton SubForumListLogoutButton;
    private javax.swing.JLabel SubForumListLabel;
    private javax.swing.JLabel GuestSubForumListLabel;
    private javax.swing.JList SubForumListList;
    private javax.swing.JList GuestSubForumListList;
    private javax.swing.JButton GuestBackButton;
    private javax.swing.JLabel SubForumNameLabel;
    private javax.swing.JTextField SubForumNameTextField;
    private javax.swing.JPanel SubForumsListPanel;
    private javax.swing.JPanel GuestSubForumsListPanel;
    private javax.swing.JPanel GuestSubs;
    private javax.swing.JButton ThreadBackButton;
    private javax.swing.JLabel ThreadContentLabel;
    private javax.swing.JButton ThreadListBackButton;
    private javax.swing.JLabel ThreadListHeadlineLabel;
    private javax.swing.JList ThreadListList;
    private javax.swing.JPanel ThreadListPanel;
    private javax.swing.JPanel ThreadPanel;
    private javax.swing.JLabel ThreadTitleLabel;
    private javax.swing.JButton UserPassButton;
    private javax.swing.JLabel UsernameLabel;
    private javax.swing.JTextField UsernameTextField;
    private javax.swing.JPanel WelcomePanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13; 
    private javax.swing.JScrollPane jScrollPane14; 
    private javax.swing.JLabel welcomeLabel;
    private javax.swing.JLabel welcomeLabel1;
    // End of variables declaration//GEN-END:variables
    
    ServerMessages messages;
    String serverAns[];
    String userID;
    boolean login = false;
    String forumID;
    String subforumID;
    String postID;
            
    private void popupError(String msg) {
        JOptionPane.showMessageDialog(this,
        msg,
        "SE-FORUM",
        JOptionPane.WARNING_MESSAGE);
        System.exit(1);
    }
}

